package bintree;

/**
 * @author yuisama
 * @date 2022/05/11 21:35
 **/
public class TreeTest {
    public static void main(String[] args) {
        MyBinTree binTree = new MyBinTree();
        binTree.build();
        System.out.println("层序遍历结果为:");
        binTree.levelOrder(binTree.root);
        System.out.println("当前二叉树中一共有" + binTree.getNodesNonRecursion(binTree.root)+"个节点");
//        System.out.println("前序遍历结果为 : ");
//        binTree.preOrder(binTree.root);
//        System.out.println();
//        System.out.println("中序遍历结果为 : ");
//        binTree.inOrder(binTree.root);
//        System.out.println();
//        System.out.println("后序遍历结果为 : ");
//        binTree.postOrder(binTree.root);
//        System.out.println("当前二叉树中一共有" + binTree.getNodes(binTree.root)+"个节点");
//        System.out.println("当前二叉树中一共有" + binTree.getLeafNodes(binTree.root)+"个叶子节点");
//        System.out.println("当前二叉树中第四层" + binTree.getKLevelNodes(binTree.root,4)+"个节点");
//        System.out.println("当前二叉树的高度为:" + binTree.height(binTree.root));
//        System.out.println(binTree.contains(binTree.root,'C'));
//        System.out.println(binTree.contains(binTree.root,'X'));
    }
}